<!--耗材单详情-->
<div class="wrap">
	<div class="header">
		<span id="return">返回上一级</span>
	</div>
	<!--详情内容-->
	<ul class="order_list">
		<li>
			<label>订单编号</label>
			<span id="orderId"></span>
		</li>
		<li>
			<label>耗材单状态</label>
			<span id="status"></span>
		</li>
		<li>
			<label>纸张种类</label>
			<span id="paperType"></span>
		</li>
		<li>
			<label>纸张规格</label>
			<span id="paperSize"></span>
		</li>
		<li>
			<label>纸张数量</label>
			<span id="paperNum"></span>
		</li>
		<li>
			<label>油墨种类</label>
			<span id="inkType"></span>
		</li>
		<li>
			<label>油墨数量</label>
			<span id="inkNum"></span>
		</li>
		<li>
			<label>材料品类</label>
			<span id="materialType"></span>
		</li>
		<li>
			<label>材料数量</label>
			<span id="materialNum"></span>
		</li>
		<li>
			<label>板材品类</label>
			<span id="boardType"></span>
		</li>
		<li>
			<label>板材数量</label>
			<span id="boardNum"></span>
		</li>
		<li>
			<a href="jascript:void(0)" id="orderSubmit">确认</a>
		</li>
	</ul>
</div>
<script>
	//返回上一级
	$("#return").on("click",function(){
		$("#main").empty();
		$.ajax({
			type:"get",
			url:"finace_buylist.html",
			success:function(res){
				$("#main").append(res);
			}
		});
	})
	//用cookie获取id
	var id = $.cookie("id");
	$("#orderId").text(id);
	//订单详情
	$.ajax({
		type:"post",
		url:"http://39.108.164.20/device/SysUser/BuyDetails",
		dataType:"json",
		data:{
			id:id
		},
		success:function(res){
			console.log(res);
			var data = res.result.data;
			$("#orderId").text(data.id);
			$("#status").text(data.status);
			$("#paperType").text(data.paper_type);
			$("#paperSize").text(data.paper_size);
			$("#paperNum").text(data.paper_num);
			$("#inkType").text(data.ink_type);
			$("#inkNum").text(data.ink_num);
			$("#materialType").text(data.material_type);
			$("#materialNum").text(data.material_num);
			$("#boardType").text(data.board_type);
			$("#boardNum").text(data.board_num);
			
		}
	});
	//确认订单
	$("#orderSubmit").on("click",function(){
		$.ajax({
			type:"post",
			url:"http://39.108.164.20/device/SysUser/SureBuy",
			dataType:"json",
			data:{
				id:id
			},
			success:function(res){
				alert(res.result.msg)
			}
		});
	})
</script>

